
<html>
<head>
    <meta charset="UTF-8"/>
    <title>ActiveX组件调用示例
    </title>
    <OBJECT ID=sk
            CLASSID="clsid:003BD8F2-A6C3-48EF-9B72-ECFD8FC4D49F"
            codebase="NISEC_SKSCX.ocx#version=1,0,0,1">
    </OBJECT>


</head>
<body bgcolor=#f0f0ff>
<div align="center">
    <form name=formData>
        <table border=2 cellspacing=0>
            <caption ><font size=6 color=#0000ff>ActiveX组件调用示例</font></caption>
            <br>
            <tr height=50>
                <td width="300" align="center"><input type="button" value="参数设置" onclick="SetParameter();"></td>
                <td width="300" align="center"><input type="button" value="税控钥匙信息查询" onclick="KeyQuery();"></td>
                <td width="300" align="center"><input type="button" value="页边距设置" onclick="SetMargin();"></td>
                <td width="300" align="center"><input type="button" value="查询当前未开票号" onclick="QueryUnfill();"></td>
                <td width="300" align="center"><input type="button" value="获取监控管理数据" onclick="GetMonitorData();"></td>
                <td width="300" align="center"><input type="button" value="发票领购信息查询" onclick="QueryPurchase();"></td>
                <td width="300" align="center"><input type="button" value="发票查询" onclick="QueryInvioce();"></td>
            </tr>
            <br>
        </table>
    </form>
</div>

<script language="javascript">
    function SetParameter()
    {
        var sInputInfo =
            "<?xml version=\"1.0\" encoding=\"gbk\"?>\r\n" +
            "<business id=\"20001\" comment=\"参数设置\">\r\n" +
            "<body yylxdm=\"1\">\r\n" +
            "<servletip>guilinyang.imwork.net</servletip>\r\n" +
            "<servletport>8081</servletport>\r\n" +
            "<keypwd>88888888</keypwd>\r\n" +
            "</body>\r\n" +
            "</business>";
        alert(sInputInfo);
        try
        {
            ret = sk.Operate(sInputInfo);
            alert(ret);
        }
        catch(e)
        {
            alert(e.message + ",errno:" + e.number);
        }
    }

    function KeyQuery()
    {
        var sInputInfo = "<?xml version=\"1.0\" encoding=\"gbk\"?>\r\n<business id=\"20002\" comment=\"税控钥匙信息查询\">\r\n<body yylxdm=\"1\">\r\n<keypwd>00000000</keypwd>\r\n</body>\r\n</business>";
        alert(sInputInfo);
        try
        {
            ret = sk.Operate(sInputInfo);
            alert(ret);
        }
        catch(e)
        {
            alert(e.message + ",errno:" + e.number);
        }
    }

    function SetMargin()
    {
        var sInputInfo = "<?xml version=\"1.0\" encoding=\"gbk\"?>\n" +
            "<business id=\"20003\" comment=\"页边距设置\">\n" +
            "<body yylxdm=\"1\">\n" +
            "<fplxdm>007</fplxdm>\n" +
            "<top>20</top>\n" +
            "<left>30</left>\n" +
            "</body>\n" +
            "</business>\n";
        alert(sInputInfo);
        try
        {
            ret = sk.Operate(sInputInfo);
            alert(ret);
        }
        catch(e)
        {
            alert(e.message + ",errno:" + e.number);
        }
    }

    function QueryUnfill()
    {
        var sInputInfo = "<?xml version=\"1.0\" encoding=\"gbk\"?>\n" +
            "<business id=\"10004\" comment=\"查询当前未开票号\">\n" +
            "<body yylxdm=\"1\">\n" +
            "<kpzdbs>gt01</kpzdbs>\n" +
            "<fplxdm>007</fplxdm>\n" +
            "</body>\n" +
            "</business>\n";
        alert(sInputInfo);
        try
        {
            ret = sk.Operate(sInputInfo);
            alert(ret);
        }
        catch(e)
        {
            alert(e.message + ",errno:" + e.number);
        }
    }

    function GetMonitorData()
    {
        var sInputInfo = "<?xml version=\"1.0\" encoding=\"gbk\"?>\n" +
            "<business id=\"10002\" comment=\"获取监控管理数据\">\n" +
            "<body yylxdm=\"1\">\n" +
            "<kpzdbs>gt01</kpzdbs>\n"+
            "<fplxdm>007</fplxdm>\n" +
            "</body>\n" +
            "</business>\n";
        alert(sInputInfo);
        try
        {
            ret = sk.Operate(sInputInfo);
            alert(ret);
        }
        catch(e)
        {
            alert(e.message + ",errno:" + e.number);
        }
    }

    function QueryPurchase()
    {
        var sInputInfo = "<?xml version=\"1.0\" encoding=\"gbk\"?>\n" +
            "<business id=\"10005\" comment=\"发票领购信息查询\">\n" +
            "<body yylxdm=\"1\">\n" +
            "<nsrsbh>91460100MA5RF8R816</nsrsbh>\n" +
            "<kpzdbs></kpzdbs>\n" +
            "<fplxdm>007</fplxdm>\n" +
            "<fpzt>0</fpzt>\n" +
            "<lgqxx></lgqxx>\n" +
            "</body>\n" +
            "</business>"
        alert(sInputInfo);
        try
        {
            ret = sk.Operate(sInputInfo);
            alert(ret);
        }
        catch(e)
        {
            alert(e.message + ",errno:" + e.number);
        }
    }

    function QueryInvioce()
    {
        var sInputInfo = "<?xml version=\"1.0\" encoding=\"gbk\"?>\n" +
            "<business id=\"10010\" comment=\"发票查询\">\n" +
            "<body yylxdm=\"1\">\n" +
            "<kpzdbs>gt01</kpzdbs>\n" +
            "<fplxdm>007</fplxdm>\n" +
            "<cxfs>1</cxfs>\n" +
            "<cxtj>2018010120180201</cxtj>\n" +
            "</body>\n" +
            "</business>"
        alert(sInputInfo);
        try
        {
            ret = sk.Operate(sInputInfo);
            alert(ret);
        }
        catch(e)
        {
            alert(e.message + ",errno:" + e.number);
        }
    }

</script>




</body>
</html>